package co.wangdao.xingshaoye.view.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import co.wangdao.xingshaoye.R;
import co.wangdao.xingshaoye.view.activity.Information;
import co.wangdao.xingshaoye.view.activity.Register;
import co.wangdao.xingshaoye.view.activity.kitchen;
import co.wangdao.xingshaoye.view.activity.my_attention;
import co.wangdao.xingshaoye.view.activity.my_master;
import co.wangdao.xingshaoye.view.activity.my_wallet;
import co.wangdao.xingshaoye.view.activity.order;
import co.wangdao.xingshaoye.view.activity.Personal_data;
import co.wangdao.xingshaoye.view.activity.shipping_address;
import co.wangdao.xingshaoye.view.activity.set;

/**
 * Created by Administrator on 2016/2/25 0025.
 */
public class Fragment_person extends Fragment implements View.OnClickListener {
    private RelativeLayout Personal_data;//个人资料
    private RelativeLayout order;//我的订单
    private RelativeLayout my_wallet;//我的钱包
    private RelativeLayout my_attention;//我的活动
    private RelativeLayout shipping_address;//送餐地址
    private RelativeLayout my_master;//我的少爷
    private RelativeLayout kitchen;//我的厨房
    private RelativeLayout set;//设置
    private TextView register;//登录注册
    private ImageView face_img;//头像图片
    private LinearLayout information1;//消息提示
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.layout_person,container,false);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        Personal_data =(RelativeLayout)view.findViewById(R.id.personal_data);
        order =(RelativeLayout)view.findViewById(R.id.order);
        my_wallet =(RelativeLayout)view.findViewById(R.id.my_wallet);
        my_attention =(RelativeLayout)view.findViewById(R.id.my_attention);
        shipping_address =(RelativeLayout)view.findViewById(R.id.shipping_address);
        my_master =(RelativeLayout)view.findViewById(R.id.my_master);
        kitchen =(RelativeLayout)view.findViewById(R.id.kitchen);
        set =(RelativeLayout)view.findViewById(R.id.set);
        register=(TextView) view.findViewById(R.id.register);
        face_img=(ImageView) view.findViewById(R.id.face_img);
        information1=(LinearLayout) view.findViewById(R.id.information1);

          /*为消息中心设置点击事件并判断*/
        register.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),Register.class);
                startActivity(intent);
            }
        });

        /*为消息中心设置点击事件并判断*/
        information1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),Information.class);
                startActivity(intent);
            }
        });

         /*为头像图片设置点击事件并判断*/
        face_img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),Personal_data.class);
                startActivity(intent);
            }
        });


          /*为个人资料设置点击事件并判断*/
        Personal_data.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),Personal_data.class);
                startActivity(intent);
            }
        });
         /*为订单设置点击事件并判断*/
        order.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           Intent intent = new Intent(getActivity(),order.class);
                startActivity(intent);
            }
        });
        /*为我的钱包设置点击事件并判断*/
        my_wallet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           Intent intent = new Intent(getActivity(),my_wallet.class);
                startActivity(intent);
            }
        });
        /*为我的关注设置点击事件并判断*/
        my_attention.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           Intent intent = new Intent(getActivity(),my_attention.class);
                startActivity(intent);
            }
        });
        /*为送餐地址设置点击事件并判断*/
        shipping_address.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           Intent intent = new Intent(getActivity(),shipping_address.class);
                startActivity(intent);
            }
        });
        /*为我的少爷设置点击事件并判断*/
        my_master.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           Intent intent = new Intent(getActivity(),my_master.class);
                startActivity(intent);
            }
        });
        /*为我要加盟设置点击事件并判断*/
        kitchen.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           Intent intent = new Intent(getActivity(),kitchen.class);
                startActivity(intent);
            }
        });
        /*为设置选项设置点击事件并判断*/
        set.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
           Intent intent = new Intent(getActivity(),set.class);
                startActivity(intent);
            }
        });
    }

    @Override
    public void onClick(View v) {

    }


}
